

package GUI_3GE;
import pkg3hge_plh24.*;

public class AdministratorFrame extends javax.swing.JFrame {

    public AdministratorFrame(DBManager dbm, Users controlledUser ) {
        initComponents();
    }

    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        adminTextLabel = new javax.swing.JLabel();
        adminLogoLabel = new javax.swing.JLabel();
        addRestaurantButton = new javax.swing.JButton();
        modifyRestaurantButton = new javax.swing.JButton();
        deleteRestaurantButton = new javax.swing.JButton();
        exitAdminButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Εφαρμογή City Guide");

        adminTextLabel.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        adminTextLabel.setText("Συνδεθήκατε ως Διαχειριστής");
        adminTextLabel.setToolTipText("");

        adminLogoLabel.setIcon(new javax.swing.ImageIcon(getClass().getResource("/GUI_3GE/logo.png"))); // NOI18N
        adminLogoLabel.setToolTipText("");

        addRestaurantButton.setText("Εισαγωγή Εστιατορίου");
        addRestaurantButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                addRestaurantButtonActionPerformed(evt);
            }
        });

        modifyRestaurantButton.setText("Τροποποίηση Εστιατορίου");
        modifyRestaurantButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                modifyRestaurantButtonActionPerformed(evt);
            }
        });

        deleteRestaurantButton.setText("Διαγραφή Εστιατορίου");
        deleteRestaurantButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                deleteRestaurantButtonActionPerformed(evt);
            }
        });

        exitAdminButton.setText("Έξοδος");
        exitAdminButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitAdminButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(adminLogoLabel)
                    .addGroup(layout.createSequentialGroup()
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(exitAdminButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(deleteRestaurantButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(addRestaurantButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(modifyRestaurantButton, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                        .addGap(18, 18, 18)
                        .addComponent(adminTextLabel)))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(adminLogoLabel)
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(addRestaurantButton)
                    .addComponent(adminTextLabel))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(modifyRestaurantButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(deleteRestaurantButton)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(exitAdminButton)
                .addContainerGap(38, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitAdminButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitAdminButtonActionPerformed
       System.exit(0); //έξοδος
    }//GEN-LAST:event_exitAdminButtonActionPerformed

    private void addRestaurantButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addRestaurantButtonActionPerformed
     AddRestaurantPanel addRest = new AddRestaurantPanel();
     addRest.setVisible(true);
     this.dispose();
    }//GEN-LAST:event_addRestaurantButtonActionPerformed

    private void modifyRestaurantButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modifyRestaurantButtonActionPerformed
       SelectModifyRestaurantFrame modRest = new SelectModifyRestaurantFrame();
       modRest.setVisible(true);
       this.dispose();
    }//GEN-LAST:event_modifyRestaurantButtonActionPerformed

    private void deleteRestaurantButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_deleteRestaurantButtonActionPerformed
        Select2DeleteRestaurantFrame delRest = new Select2DeleteRestaurantFrame();
        delRest.setVisible(true);
        this.dispose() ;
    }//GEN-LAST:event_deleteRestaurantButtonActionPerformed



    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton addRestaurantButton;
    private javax.swing.JLabel adminLogoLabel;
    private javax.swing.JLabel adminTextLabel;
    private javax.swing.JButton deleteRestaurantButton;
    private javax.swing.JButton exitAdminButton;
    private javax.swing.JButton modifyRestaurantButton;
    // End of variables declaration//GEN-END:variables

}
